Validates a string to check if it is an email or not. A great and safer alternative to javascript.

Add this to your code and assign the string to $email... like a bug in a rug. :)

================================================

<?php
//Email Validation

if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) {
      $msg = "<h4>Error: Invalid email address</h4>";
      $msg .= "<a href='javascript:history.back(1);'>Go Back</a>";
    }
?>